package edu.xpu.cs.hub.mapper;


import edu.xpu.cs.hub.entity.Node;
import edu.xpu.cs.hub.entity.Process;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.List;

@Mapper
@Component
public interface ProcessMapper {

    //插入
    @Insert({"insert into process (id,name,url,location,date,category) values (#{id},#{name},#{url},#{location},#{date},#{category})"})
    public int insertProcess2sql(@Param("id")String id,@Param("name")String name,@Param("url")String url,@Param("location")String location,@Param("date") Date date,@Param("category") String category);

    //查询
    @Select("select * from process")
    public List<Process> selectAll();

    @Select("delete from process where name = #{name,jdbcType=VARCHAR}")
    public String deleteProcess(String name);

    @Select("select * from process where name = #{name,jdbcType=VARCHAR}")
    public List<Process> processInfo(String nodeName);
}














